<?php

class tplFormanswer extends StudyBuddy\Template\Template {

    protected static $vars = array(
        'token' => '', //1
        'required' => 'required', //2
        'qbody' => '', //3
        'qbody_e' => '', //4
        'submit' => 'Submit answer', //5
        'com_hand' => '', // 6
        'readonly' => '', // 7
        'disabled' => '', // 8
        'connectBlock' => '', // 9
        'formError' => '', // 10
        'title' => 'Answer this question', //11
        'qid' => '', //12
        'socials' => '', //13
        'preview' => 'Preview' //14
    );
    protected static $tpl = '
<script type="text/javascript" src="/js/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
    tinyMCE.init({
        // General options
        mode : "textareas",
        theme : "advanced",
        relative_urls : false,
        width : "594",
        height : "200",
        object_resizing : false,
        plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advlink,emotions,equation,iespell,inlinepopups,insertdatetime,preview,media,jbimages,searchreplace,print,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave",
//        plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,equation,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave",

        // Theme options
        theme_advanced_buttons1 : "equation,jbimages",
//        theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,cleanup,|,equation,|,image",
//        theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
        theme_advanced_buttons2 : "",
//        theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
        theme_advanced_buttons3 : "",
//        theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,equation,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
        theme_advanced_buttons4 : "",
//        theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "left",
//        theme_advanced_statusbar_location : "bottom",
        theme_advanced_statusbar_location : false,
        theme_advanced_resizing : false,

        file_browser_callback : "ajaxfilemanager",

        // Example content CSS (should be your site CSS)
        content_css : "css/content.css",

        // Drop lists for link/image/media/template dialogs
        template_external_list_url : "lists/template_list.js",
        external_link_list_url : "lists/link_list.js",
        external_image_list_url : "lists/image_list.js",
        media_external_list_url : "lists/media_list.js",

        // Style formats
        style_formats : [
            {title : "Bold text", inline : "b"},
            {title : "Red text", inline : "span", styles : {color : "#ff0000"}},
            {title : "Red header", block : "h1", styles : {color : "#ff0000"}},
            {title : "Example 1", inline : "span", classes : "example1"},
            {title : "Example 2", inline : "span", classes : "example2"},
            {title : "Table styles"},
            {title : "Table row 1", selector : "tr", classes : "tablerow1"}
        ],

        // Replace values for the template plugin
        template_replace_values : {
            username : "Some User",
            staffid : "991234"
        },

        custom_elements: "m",
        extended_valid_elements: "m"
    });
</script>
	<div style="margin-top: 10px; margin-left: 29px; float: left;font-size: 12pt;font-weight: bold;">Answer this question</div>
	<div id="answer_form" class="form_wrap" style="margin-left:29px; width:594px; overflow:hidden">
	<div class="form_error">%10$s</div>
		<form class="qa_form" name="ansForm" method="POST" action="/index.php" accept-charset="utf-8">
		<input type="hidden" name="a" value="answer">
		<input type="hidden" name="qid" value="%12$s">	
		<input type="hidden" name="token" value="%1$s">
		%9$s
            <div class="form_el"> 
                <textarea id="id_qbody" rows="10" cols="40" class="com_body%6$s" name="qbody" %7$s>%3$s</textarea><br>
                <span class="f_err">%4$s</span>
                <!-- <div id="body_preview"></div>
                <span class="label">%14$s</span>
                <div id="tmp_preview"></div> -->
            </div>
            <!-- // el body -->
            <div class="fl cb socials">
				%13$s
            </div>
            <div class="form_el" style="margin-top:0">
            	<input id="dostuff" name="submit" type="submit" value="%5$s" %8$s class="btn btn-m"> 
            </div>
            <!-- // el submit -->
		</form>
	</div>';

}